import React from 'react';
import {messages} from "share/common";
import {Badge} from 'antd';

import plane from 'containers/financial-management/check-center/columns/plane-columns'
import hotel from 'containers/financial-management/check-center/columns/hotel-columns'
import train from 'containers/financial-management/check-center/columns/train-columns'
import car from 'containers/financial-management/check-center/columns/car-columns'
import telephone from 'containers/financial-management/check-center/columns/telephone-columns'
import orderMeal from 'containers/financial-management/check-center/columns/order-meal-columns'
import CommonColumns from 'containers/financial-management/check-center/columns/common-columns'


export default {

  getColumns(type, fun) {
    const columns = {
      air: this.commonOprtationColumns(plane.planeColumns(fun)),
      hotel: this.commonOprtationColumns(hotel.hotelColumns()),
      train: this.commonOprtationColumns(train.trainColumns()),
      car: this.commonOprtationColumns(car.carColumns(),type),
      yget: this.commonOprtationColumns(telephone.telephoneColumns()),
      dining: this.commonOprtationColumns(orderMeal.getOrderMealsColumns()),
    };
    return columns[type];
  },

  getOffLineColumns(type, fun) {
    const columns = this.getColumns(type, fun);
    columns.splice(1, 0, {// 添加核对结果
      title: messages('financial-management.key694')/*核对结果*/,
      dataIndex: 'matching',
      render: value => value ? 'Y' : 'N',
      width: 120,
    });
    return columns;
  },

  commonOprtationColumns(columns, type) {
    if(type == 'car') {
      return columns
    }
    const opinionMsg = CommonColumns.getOpinionMsg()
    columns = opinionMsg.concat(columns);
    const addItems = CommonColumns.getCheckStatusAbout();
    return columns.concat(addItems);
  }

}
